package com.wcj.study.multidatasource.config;

/**
 * 
 * TODO 添加类描述
 * 
 * @author 汪长军 Email：changjunwang@xinhe99.com
 * @date 2019-01-03 上午9:50:34
 * @copyright 信和上融网络科技(北京)有限公司
 */
public final class MultiDataSourceContext {

	private MultiDataSourceContext() {

	}
	
	private static final ThreadLocal<String> CONTEXT_HOLDER = new InheritableThreadLocal<String>() {
	    
		@Override
		protected String initialValue() {
			return "";
		}
	};

	public static void set(String dsKey) {
		CONTEXT_HOLDER.set(dsKey);
	}

	public static String get() {
		return CONTEXT_HOLDER.get();
	}

	public static void remove() {
		CONTEXT_HOLDER.remove();
	}
	
}
